package di.main;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import di.hello.Hello;

public class TestHello {
	public static void main(String[] args) {
		//1. Spring 컨테이너 객체 생성 - 생성자에 Spring설정파일의 위치를 지정
		ApplicationContext context = new ClassPathXmlApplicationContext("di/config/applicationContext.xml");
		//2. 객체 요청(의존객체 주입받기)
		Object obj = context.getBean("hello");
		Hello hello = (Hello)obj;
		System.out.println(hello.sayHello("홍길동"));
	}
}
